<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/salesreturnsfolder/SalesReturns.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/salesreturnsfolder/SalesReturns.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'SalesReturnsId',
                footer: "Foots",
                cnName: '销售退货',
                name: 'salesreturnsfolder/SalesReturns',
                url: "/SalesReturns/",
                sortName: "SalesReturnsId"
            });
            const editFormFields = ref({"MarketId":"","ProductName":"","ProductCode":"","ProductSKU":"","Unit":"","Price":"","SalesReturnsNum":"","SalesReturnsTotal":"","ClientId":"","SalesReturnsState":"","CreateTime":"","IsDeleted":""});
            const editFormOptions = ref([[{"title":"销售编号","field":"MarketId"}],
                              [{"title":"产品名称","field":"ProductName"}],
                              [{"title":"产品编号","field":"ProductCode"}],
                              [{"title":"产品规格","field":"ProductSKU"}],
                              [{"title":"单位","required":true,"field":"Unit"}],
                              [{"title":"单价","field":"Price","type":"decimal"}],
                              [{"title":"退货数量","field":"SalesReturnsNum","type":"number"}],
                              [{"title":"总额","field":"SalesReturnsTotal","type":"decimal"}],
                              [{"title":"客户编号","field":"ClientId"}],
                              [{"title":"状态","field":"SalesReturnsState","type":"number"}],
                              [{"title":"创建时间","field":"CreateTime"}],
                              [{"title":"是否删除","field":"IsDeleted"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'SalesReturnsId',title:'退货编号',type:'string',sort:true,width:220,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'MarketId',title:'销售编号',type:'string',width:220,align:'left',sort:true},
                       {field:'ProductName',title:'产品名称',type:'string',width:110,align:'left'},
                       {field:'ProductCode',title:'产品编号',type:'string',width:220,align:'left'},
                       {field:'ProductSKU',title:'产品规格',type:'string',width:220,align:'left'},
                       {field:'Unit',title:'单位',type:'string',width:220,require:true,align:'left'},
                       {field:'Price',title:'单价',type:'decimal',width:110,align:'left'},
                       {field:'SalesReturnsNum',title:'退货数量',type:'int',width:110,align:'left'},
                       {field:'SalesReturnsTotal',title:'总额',type:'decimal',width:110,align:'left'},
                       {field:'ClientId',title:'客户编号',type:'string',width:220,align:'left'},
                       {field:'SalesReturnsState',title:'状态',type:'int',width:110,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'IsDeleted',title:'是否删除',type:'sbyte',width:110,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
